﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace YXShop.Web.membercenter.shop.shop_administer
{
    public partial class shop_order_edit : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
           if(!IsPostBack)
           {
               int id = ChangeHope.WebPage.PageRequest.GetQueryInt("OrderId");
               #region 订单操作
                string option = ChangeHope.WebPage.PageRequest.GetQueryString("option");
                if (option != string.Empty && id > 0)
                {
                    YXShop.BLL.Order.Orders orderBll = new YXShop.BLL.Order.Orders();
                    YXShop.Model.Order.Orders orderModel = orderBll.GetModel(id);
                    //确认
                    if (option == "confirm")
                    {
                        int Status = YXShop.Common.OrdersStatusEnum.OrderStatu.已经确认.GetHashCode();
                        ModfiyOrderStatus(id, "OrderStatus", Status, "操作成功，订单已经确认。");
                    }
                    //取消
                    else if (option == "cancel")
                    {
                        int Status = YXShop.Common.OrdersStatusEnum.OrderStatu.取消确认.GetHashCode();
                        ModfiyOrderStatus(id, "OrderStatus", Status, "操作成功，订单已经取消确认。");
                    }
                    //暂停
                    else if (option == "stop")
                    {
                        int Status = YXShop.Common.OrdersStatusEnum.OrderStatu.暂停处理.GetHashCode();
                        ModfiyOrderStatus(id, "OrderStatus", Status, "操作成功，订单已经暂停处理。");
                    }
                    //正常
                    else if (option == "goon")
                    {
                        int Status = YXShop.Common.OrdersStatusEnum.OrderStatu.等待处理.GetHashCode();
                        ModfiyOrderStatus(id, "OrderStatus", Status, "操作成功，订单已经回复正常。");
                    }

                }
               #endregion
               if (id > 0)
               {   
                   this.InitWebControl(id);
                   this.OrderInfo(id);
                   this.OrdersProduct(id);
                   this.lblMoneyList.Text = this.GetMoneyList(this.blOrderNo.Text.Trim());
                   this.lblConsignList.Text = this.GetConsignList(this.blOrderNo.Text.Trim());
                   this.lblTransList.Text = this.GetTransList(this.blOrderNo.Text.Trim());
                   this.lblOrderLeaveList.Text = this.GetOrderLeaveList(this.blOrderNo.Text.Trim());
               }
           }
        }


        private void ModfiyOrderStatus(int id, string ColumnName, int Value, string Str)
        {
            YXShop.BLL.Order.Orders ordbll = new YXShop.BLL.Order.Orders();
            ordbll.Amend(id, ColumnName, Value);
            ChangeHope.WebPage.Script.AlertAndRedirect(Str, "shop_order_edit.aspx?OrderId=" + id + "");
        }
        #region 订单信息
        private void OrderInfo(int id)
        {
            YXShop.BLL.Order.Orders bll = new YXShop.BLL.Order.Orders();
            YXShop.Model.Order.Orders model = bll.GetModel(id);
            if (model != null)
            {
                YXShop.BLL.Member.MemberAccount mabll = new YXShop.BLL.Member.MemberAccount();
                YXShop.Model.Member.MemberAccount mamodel = mabll.GetModel(model.UserId);
                if (mamodel != null)
                {
                    YXShop.BLL.Member.MemberInfo mibll = new YXShop.BLL.Member.MemberInfo();
                    YXShop.Model.Member.MemberInfo mimodel = mibll.GetModel(mamodel.UID);
                    if (mimodel != null)
                    {
                        this.lbName.Text = mimodel.TrueName;
                    }
                    this.lbUserName.Text = "<a href='../member/member_view.aspx?uid=" + mamodel.UID + "'>" + model.UserId + "</a>";
                }
                else
                {
                    this.lbUserName.Text = model.UserId;
                }
                this.blOrderNo.Text = model.OrderId;
                YXShop.Common.OrdersStatusEnum ose = new YXShop.Common.OrdersStatusEnum();
                this.lbOrderStatue.Text = ose.OrderStatus(model.OrderStatus);
                this.lbLogisticsStatus.Text = ose.OgisticsStatu(model.OgisticsStatus);
                this.lbPayment.Text = ose.PaymentStatus(model.PaymentStatus);
                this.lbOrderDateTime.Text = model.OrderDate.ToString();
                this.lbConsigneeName.Text = model.ConsigneeName;
                this.lbConsigneeAddress.Text = model.ConsigneeAddress;
                this.lbConsigneeEmail.Text = model.ConsigneeEmail;
                this.lbConsigneeModile.Text = model.ConsigneePhone;
                this.lbConsigneeTel.Text = model.ConsigneeTel;
                this.lbConsigneeZip.Text = model.ConsigneeZip;
                this.lbPaymentMode.Text = model.PaymentType == "1" ? "银行汇款" : "在线支付";
                this.lbDeliveryMode.Text = this.Courier(int.Parse(model.Courier.ToString()));
                this.lbOrderTotalPrice.Text = Convert.ToDouble(model.FactPrice).ToString("f2");
                this.lbCarriage.Text = Convert.ToDouble(model.Courier).ToString("f2");
            }
        }
        #endregion

        #region 订单商品信息
        private void OrdersProduct(int orderId)
        {
            ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table();
            YXShop.BLL.Order.OrderProduct bll = new YXShop.BLL.Order.OrderProduct();
            ChangeHope.DataBase.DataByPage dataPage = bll.GetListByPage(" and OrderId=" + orderId);
            table.AddHeadCol("", "商品名称");
            table.AddHeadCol("", "单价");
            table.AddHeadCol("", "数量");
            table.AddHeadCol("", "小计(单位：元)");
            table.AddRow();
            double ProductTotalPrice = 0;
            if (dataPage.DataReader != null)
            {
                while (dataPage.DataReader.Read())
                {
                    string fittingsProductId = dataPage.DataReader["FittingsProductId"].ToString();
                    string fittingsId = dataPage.DataReader["FittingsId"].ToString();
                    string fittingsProductCount = dataPage.DataReader["FittingsProductCount"].ToString();
                    string fittingProductInfo = "";
                    double fittingTotalPrice = 0;
                    if (!string.IsNullOrEmpty(fittingsProductId.Trim()) && !string.IsNullOrEmpty(fittingsId.Trim()) && Convert.ToInt32(fittingsId) > 0)
                    {
                        //配件
                        int fittingProductCount = 0;
                        double fittingProductWeight = 0;
                        double fittingProductIntergal = 0;
                        YXShop.Common.ProductInfo.FittingDisposal(fittingsId, fittingsProductId, fittingsProductCount, out fittingProductCount, out fittingProductInfo, out fittingTotalPrice, out fittingProductWeight, out fittingProductIntergal);
                    }
                    string specificationValue = dataPage.DataReader["Specification"].ToString();
                    string specVa = "";
                    if (specificationValue != "")
                    {
                        specVa = "&nbsp;&nbsp;" + specificationValue + "";
                    }

                    table.AddCol("<a href='../../product/productcontent.aspx?q_productid=" + dataPage.DataReader["ProId"].ToString() + "' target='_blank'>" + dataPage.DataReader["ProName"].ToString() + specVa + fittingProductInfo + "</a>");
                    table.AddCol(Convert.ToDouble(dataPage.DataReader["ProPrice"].ToString()).ToString("f4"));
                    table.AddCol(dataPage.DataReader["ProNum"].ToString());
                    table.AddCol((Convert.ToDouble(dataPage.DataReader["ProPrice"].ToString()) * Convert.ToDouble(dataPage.DataReader["ProNum"].ToString())).ToString("f4"));
                    table.AddRow();
                    ProductTotalPrice += Convert.ToDouble(dataPage.DataReader["ProPrice"].ToString()) * Convert.ToDouble(dataPage.DataReader["ProNum"].ToString()) + fittingTotalPrice;
                }
                table.AddCol("4", "<strong>合计：" + ProductTotalPrice.ToString("f4") + "</strong>");
                table.AddRow();
                string view = table.GetTable() + dataPage.PageToolBar;
                dataPage.Dispose();
                dataPage = null;
                this.litData.Text = view;
            }
            else
            {
                this.litData.Text = "没有找到该订单的商品信息";
            }

        }
        #endregion

        #region 付款信息

        /// <summary>
        /// 列表
        /// </summary>
        /// <returns></returns>
        protected string GetMoneyList(string orderId)
        {

            ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table();
            //银行资金
            YXShop.BLL.Order.RemittanceInfo remBll = new YXShop.BLL.Order.RemittanceInfo();
            ChangeHope.DataBase.DataByPage remData = remBll.GetList(" 1=1 and orderid='" + orderId + "'");
            //预付款
            YXShop.BLL.Order.PrepayMoney preBll = new YXShop.BLL.Order.PrepayMoney();
            ChangeHope.DataBase.DataByPage preData = preBll.GetList(" 1=1 and orderid='" + orderId + "'");
            //现金付款
            YXShop.BLL.Order.PaymentMoney payBll = new YXShop.BLL.Order.PaymentMoney();
            ChangeHope.DataBase.DataByPage payData = payBll.GetList(" 1=1 and orderid='" + orderId + "'");

            //第一步先添加表头
            table.AddHeadCol("", "客户名称");
            table.AddHeadCol("", "交易时间");
            table.AddHeadCol("", "交易方式");
            table.AddHeadCol("", "交易金额");
            table.AddHeadCol("", "备注/说明");
            table.AddHeadCol("", "赠送点卷");
            table.AddRow();
            //添加银行付款的内容
            if (remData.DataReader != null)
            {
                while (remData.DataReader.Read())
                {
                    table.AddCol(remData.DataReader["username"].ToString());
                    table.AddCol(remData.DataReader["remittancedate"].ToString());
                    table.AddCol("银行支付");
                    if (remData.DataReader["remittancemoney"].ToString() == "0")
                    {
                        table.AddCol("");
                    }
                    else
                    {
                        table.AddCol(remData.DataReader["remittancemoney"].ToString());
                    }
                    table.AddCol(remData.DataReader["remark"].ToString());
                    table.AddCol(remData.DataReader["presentticket"].ToString());
                    table.AddRow();
                }
            }
            //添加预付款的内容
            if (preData.DataReader != null)
            {
                while (preData.DataReader.Read())
                {
                    table.AddCol(preData.DataReader["username"].ToString());
                    table.AddCol(preData.DataReader["notedate"].ToString());
                    table.AddCol("预付款支付");
                    table.AddCol(preData.DataReader["payoutmoney"].ToString());
                    table.AddCol(preData.DataReader["remark"].ToString());
                    table.AddCol("0");
                    table.AddRow();
                }
            }
            //添加现金付款的内容
            if (payData.DataReader != null)
            {
                while (payData.DataReader.Read())
                {
                    table.AddCol(payData.DataReader["username"].ToString());
                    table.AddCol(payData.DataReader["gatheringdate"].ToString());
                    table.AddCol("预付款支付");
                    table.AddCol(payData.DataReader["gatheringmoney"].ToString());
                    table.AddCol(payData.DataReader["remark"].ToString());
                    table.AddCol(payData.DataReader["presentticket"].ToString());
                    table.AddRow();
                }
            }
            string view = table.GetTable();
            remData.Dispose();
            remData = null;
            preData.Dispose();
            preData = null;
            payData.Dispose();
            payData = null;
            return view;
        }
        #endregion

        #region 发退货记录
        protected string GetConsignList(string orderId)
        {

            ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table();
            //发货
            YXShop.BLL.Order.ConsignMent Bll = new YXShop.BLL.Order.ConsignMent();
            ChangeHope.DataBase.DataByPage pageData = Bll.GetList(" 1=1 and orderid='" + orderId + "'");

            //第一步先添加表头
            table.AddHeadCol("", "客户名称");
            table.AddHeadCol("", "交易时间");
            table.AddHeadCol("", "快递公司");
            table.AddHeadCol("", "快递单号");
            table.AddHeadCol("", "经办人");
            table.AddHeadCol("", "备注/说明");
            table.AddHeadCol("", "类型");
            table.AddRow();
            //添加发退货记录的内容
            if (pageData.DataReader != null)
            {
                while (pageData.DataReader.Read())
                {
                    table.AddCol(pageData.DataReader["username"].ToString());
                    table.AddCol(pageData.DataReader["consignmentdate"].ToString());
                    table.AddCol(pageData.DataReader["expresscompany"].ToString());
                    table.AddCol(pageData.DataReader["expressoddnumbers"].ToString());
                    table.AddCol(pageData.DataReader["consignmentpeople"].ToString());
                    table.AddCol(pageData.DataReader["remark"].ToString());
                    table.AddCol(pageData.DataReader["consignmenttype"].ToString() == "0" ? "发货" : "退货");
                    table.AddRow();
                }
            }
            string view = table.GetTable() + pageData.PageToolBar;
            pageData.Dispose();
            pageData = null;
            return view;
        }
        #endregion

        #region 订单过户记录
        protected string GetTransList(string orderId)
        {

            ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table();
            //过户
            YXShop.BLL.Order.OrderTransfer Bll = new YXShop.BLL.Order.OrderTransfer();
            ChangeHope.DataBase.DataByPage pageData = Bll.GetList(" 1=1 and orderid='" + orderId + "'");

            //第一步先添加表头
            table.AddHeadCol("", "原属客户");
            table.AddHeadCol("", "先属客户");
            table.AddHeadCol("", "手续费");
            table.AddHeadCol("", "手续费支付者");
            table.AddHeadCol("", "备注/说明");
            table.AddHeadCol("", "操作时间");
            table.AddRow();
            //过户的内容
            if (pageData.DataReader != null)
            {
                while (pageData.DataReader.Read())
                {
                    table.AddCol(pageData.DataReader["username"].ToString());
                    table.AddCol(pageData.DataReader["transfername"].ToString());
                    table.AddCol(pageData.DataReader["poundage"].ToString());
                    table.AddCol(pageData.DataReader["poundagepaymentperson"].ToString());
                    table.AddCol(pageData.DataReader["remark"].ToString());
                    table.AddCol(pageData.DataReader["uptime"].ToString());
                    table.AddRow();
                }
            }
            string view = table.GetTable() + pageData.PageToolBar;
            pageData.Dispose();
            pageData = null;
            return view;
        }
        #endregion

        #region 反馈记录
        protected string GetOrderLeaveList(string orderId)
        {

            ChangeHope.WebPage.Table table = new ChangeHope.WebPage.Table();
            //反馈
            YXShop.BLL.Order.OrderLeave Bll = new YXShop.BLL.Order.OrderLeave();
            ChangeHope.DataBase.DataByPage pageData = Bll.GetList(" 1=1 and orderid='" + orderId + "'");

            //第一步先添加表头
            table.AddHeadCol("", "内容");
            table.AddHeadCol("", "留言人账号");
            table.AddHeadCol("", "时间");
            table.AddHeadCol("", "类型");
            table.AddHeadCol("", "操作");
            table.AddRow();
            if (pageData.DataReader != null)
            {
                while (pageData.DataReader.Read())
                {
                    table.AddCol(pageData.DataReader["content"].ToString());
                    table.AddCol(pageData.DataReader["memberid"].ToString() == "-1" ? "管理员" : this.GetUserIdByuId(Convert.ToInt32(pageData.DataReader["memberid"].ToString())));
                    table.AddCol(pageData.DataReader["createdate"].ToString());
                    table.AddCol(pageData.DataReader["state"].ToString() == "1" ? "用户提交" : "管理员回复");
                    string option = string.Empty;
                    option = string.Format("<a href='javascript:void(0)' onclick='Del({0})'>删除</a> <a href=order_leave_modify.aspx?id={0}>修改</a> ", pageData.DataReader["id"].ToString());
                    if (pageData.DataReader["state"].ToString() == "1") //用户
                    {
                        option = option + string.Format("<a href=order_leave_reply.aspx?id={0}>回复</a>", pageData.DataReader["id"].ToString());
                    }
                    table.AddCol(option);
                    table.AddRow();
                }
            }
            string view = table.GetTable() + pageData.PageToolBar;
            pageData.Dispose();
            pageData = null;
            return view;
        }
        #endregion

        #region 配送信息
        private string Courier(int id)
        {
            string reStr = string.Empty;
            YXShop.BLL.Product.Deliver bll = new YXShop.BLL.Product.Deliver();
            YXShop.Model.Product.Deliver model = bll.GetModelByID(id);
            if (model != null)
            {
                reStr = model.Name;
            }
            return reStr;
        }
        #endregion

        #region 公共方法
        /// <summary>
        /// 根据ID得到订单号
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        protected string GetOrderId(int id)
        {
            YXShop.BLL.Order.Orders bll = new YXShop.BLL.Order.Orders();
            YXShop.Model.Order.Orders model = bll.GetModel(id);
            if (model != null)
            {
                return model.OrderId;
            }
            else
            {
                return string.Empty;
            }
        }

        protected string GetUserIdByuId(int uid)
        {
            YXShop.BLL.Member.MemberAccount bll = new YXShop.BLL.Member.MemberAccount();
            YXShop.Model.Member.MemberAccount model = bll.GetModel(uid);
            if (model != null)
            {
                return model.UserId;
            }
            else
            {
                return "无此用户";
            }
        }

        /// <summary>
        /// 删除订单 
        /// </summary>
        /// <param name="id"></param>
        protected void DeleteOrder(string id)
        {
            YXShop.BLL.Order.Orders bll = new YXShop.BLL.Order.Orders();
            try
            {
                bll.Delete(id);
                this.ltlMsg.Text = "操作成功，已删除该订单";
                this.pnlMsg.Visible = true;
                this.pnlMsg.CssClass = "actionOk";
            }
            catch
            {
                this.ltlMsg.Text = "操作失败";
                this.pnlMsg.Visible = true;
                this.pnlMsg.CssClass = "actionErr";
            }
        }

        /// <summary>
        /// 订单操作  更改状态
        /// </summary>
        /// <param name="id"></param>
        protected void ShowMes(string msg)
        {
            this.ltlMsg.Text = msg;
            this.pnlMsg.Visible = true;
            this.pnlMsg.CssClass = "actionOk";
        }

        /// <summary>
        /// 删除反馈
        /// </summary>
        /// <param name="id"></param>
        protected void DeleteLeave(string id)
        {
            YXShop.BLL.Order.OrderLeave bll = new YXShop.BLL.Order.OrderLeave();
            bll.Delete(id);
            Response.Write("ok");
        }
        #endregion


        #region 订单操作
        private void InitWebControl(int id)
        {
            string urlback = YXShop.TemplateAction.Common.UrlStr("shop_order_list", "", "membercenter/shop/shop_administer/");
            this.hlBacklist.NavigateUrl = urlback;
            YXShop.BLL.Order.Orders ordbll = new YXShop.BLL.Order.Orders();
            YXShop.Model.Order.Orders ordmodel = ordbll.GetModel(id);
            int OrderStatus = 0;
            int PaymentStatus = 0;
            int OgisticsStatus = 0;
            if (ordmodel != null)
            {
                OrderStatus = int.Parse(ordmodel.OrderStatus.ToString());
                PaymentStatus = int.Parse(ordmodel.PaymentStatus.ToString());
                OgisticsStatus = int.Parse(ordmodel.OgisticsStatus.ToString());
            }
            #region 订单状态
            string urlUpdate ="shop_order_update.aspx?OrderId=" + id;
            string urlclose ="shop_order_close.aspx";
            string urlConsignment ="shop_order_edit.aspx?OrderId=" + id + "&option=confirm";
            string urlSuspend ="shop_order_edit.aspx?OrderId=" + id + "&option=stop";
            string urlResume ="shop_order_edit.aspx?OrderId=" + id + "&option=goon";
            string urlCancel ="shop_order_edit.aspx?OrderId=" + id + "&option=cancel";
            string urlConsign ="shop_consignmentOrderId=" + id;
            switch (OrderStatus)
            {
                //订单状态（0等待处理, 1暂停处理, 2已经确认, 3末确认, 4未结清, 5已结清, 6取消, 7已经作废）

                case 0:              
                    this.hlUpdatePrice.NavigateUrl = urlUpdate;  //修改
                    this.hlCloseOrder.NavigateUrl = urlclose;   //作废 关闭                                                                                   
                    this.hlConfirmOrder.NavigateUrl = urlConsignment;//确认订单
                    this.hlCancelConfirm.Enabled = false;//取消确认
                    this.hlConsignment.Enabled = false;//发货
                    this.hlResumeNormal.Enabled = false;//恢复正常
                    this.hlSuspendHandleOrder.NavigateUrl=urlSuspend;//暂停处理
                    this.hlReturned.Enabled = false;
                    this.hlSign.Enabled = false;
                    break;
                   // 1暂停处理
                case 1:
                    this.hlUpdatePrice.NavigateUrl = urlUpdate;
                    this.hlCloseOrder.NavigateUrl = urlclose;
                    this.hlConsignment.Enabled = false;//发货    
                    this.hlConfirmOrder.Enabled = false;//确认订单
                    this.hlCancelConfirm.Enabled = false;//取消确认
                    this.hlResumeNormal.NavigateUrl = urlResume;//恢复正常
                    this.hlSuspendHandleOrder.Enabled = false;//暂停处理
                    this.hlReturned.Enabled = false;
                    this.hlSign.Enabled = false;
                    break;
                //2已经确认
                case 2:
                    this.hlUpdatePrice.Enabled = false;
                    this.hlCloseOrder.Enabled = false;                    
                    this.hlConfirmOrder.Enabled = false;//确认订单                  
                    this.hlResumeNormal.Enabled=false;//恢复正常
                    this.hlSuspendHandleOrder.Enabled = false;//暂停处理
                    if (OgisticsStatus == 1)
                    {
                        this.hlConsignment.Enabled = false;
                        this.hlCancelConfirm.Enabled = false;
                        
                    }
                    else
                    {
                       
                        if (PaymentStatus == 1 || PaymentStatus == 2 || PaymentStatus==3 )
                        {
                            this.hlConsignment.NavigateUrl = urlConsign;//发货  
                            this.hlCancelConfirm.Enabled = false;
                        }
                        else
                        {
                            this.hlConsignment.Enabled = false;
                            this.hlCancelConfirm.NavigateUrl = urlCancel;
                        }
                        
                    }
                    if (OgisticsStatus == 4)
                    {
                        this.hlReturned.NavigateUrl = "";
                        this.hlSign.NavigateUrl = "";
                    }
                    else
                    {
                        this.hlReturned.Enabled = false;
                        this.hlSign.Enabled = false;
                    }
                    break;
                //未确认
                case 3:
                    this.hlUpdatePrice.Enabled = false;
                    this.hlCloseOrder.Enabled = false;
                    this.hlConsignment.Enabled=false;//发货    
                    this.hlConfirmOrder.NavigateUrl = urlConsignment;//确认订单
                    this.hlCancelConfirm.Enabled = false;//取消确认
                    this.hlResumeNormal.Enabled = false;//恢复正常
                    this.hlSuspendHandleOrder.Enabled = false;//暂停处理
                    this.hlReturned.Enabled = false;
                    this.hlSign.Enabled = false;
                    break;
                //4未结清
                case 4:
                    this.hlUpdatePrice.Enabled = false;
                    this.hlCloseOrder.Enabled = false;
                    this.hlResumeNormal.Enabled=false;
                    this.hlConfirmOrder.Enabled = false;
                    this.hlCancelConfirm.Enabled = false;
                    this.hlSuspendHandleOrder.Enabled = false;
                    if (PaymentStatus == 1)
                    {

                        this.hlConsignment.NavigateUrl = urlConsign;
                    }
                    else
                    {
                        this.hlConsignment.Enabled = false;
                    }
                    #region 配送状态
                    if (OgisticsStatus == 1)
                    {
                        this.hlConsignment.Enabled = false;
                     
                    }
                    #endregion
                    break;
                case 5:
                    this.hlUpdatePrice.Enabled = false;
                    this.hlCloseOrder.Enabled = false;
                    this.hlConsignment.Enabled = false;//发货                 
                    this.hlConfirmOrder.Enabled = false;//确认订单
                    this.hlCancelConfirm.Enabled = false;//取消确认
                    this.hlResumeNormal.Enabled = false;//恢复正常
                    this.hlSuspendHandleOrder.Enabled = false;//暂停处理
                    this.hlReturned.Enabled = false;
                    this.hlSign.Enabled = false;
                    break;
                case 6:
                    this.hlUpdatePrice.NavigateUrl = urlUpdate;  //修改
                    this.hlCloseOrder.NavigateUrl = urlclose;   //作废 关闭                                                                                   
                    this.hlConfirmOrder.NavigateUrl = urlConsignment;//确认订单
                    this.hlCancelConfirm.Enabled = false;//取消确认
                    this.hlConsignment.Enabled = false;//发货
                    this.hlResumeNormal.Enabled = false;//恢复正常
                    this.hlSuspendHandleOrder.NavigateUrl = urlSuspend;//暂停处理
                    this.hlReturned.Enabled = false;
                    this.hlSign.Enabled = false;
                    break;
                default:
                    this.hlUpdatePrice.Enabled = false;
                    this.hlCloseOrder.Enabled = false;
                    this.hlConsignment.Enabled = false;//发货                 
                    this.hlConfirmOrder.Enabled = false;//确认订单
                    this.hlCancelConfirm.Enabled = false;//取消确认
                    this.hlResumeNormal.Enabled = false;//恢复正常
                    this.hlSuspendHandleOrder.Enabled = false;//暂停处理
                    this.hlReturned.Enabled = false;
                    this.hlSign.Enabled = false;
                    break;
            }
            #endregion
        }
        #endregion

    }
}
